<!--
 * Copyright ©
 * #  
 * @author: zw
 * @date: 2022-03-24 
 -->


<template>
  <el-row>
    <el-col :span="12" :offset="6" style="height: 300px">
      <merge-table :table-data="tableData" :col-configs="colConfigs" :merge-columns="mergeColumns" />
    </el-col>
  </el-row>
</template>

<script>
const random = Math.random;
const floor = Math.floor;
import MergeTable from '@/components/MergeTable'
export default {
  name: 'Other',
  components: { MergeTable },
  data() {
    return {
      // tableData: Array.apply(null, { length: 10 }).map((_, i) => ({
      //   ip: i % 4 ? '192.168.1.1' : '192.168.1.' + floor(random() * 255),
      //   mac: '7d:dd:1c:9d:2e:f8',
      //   name: `摄像头${i + 1}`,
      //   online: Math.random() * 2 > 1 ? 1 : 0,
      //   slowStatus: Math.random() * 2 > 1 ? 1 : 0,
      //   multiplePorts: Math.random() * 2 > 1 ? floor(random() * 10) + 1 : 1,
      //   status: Math.random() * 2 > 1 ? 1 : 0,
      //   updateTime: '2020-03-01 12:00:00'
      // })),
      tableData: [
        { time: '2020-08-10', grade: '三年二班', name: '小明', subjects: '语文' },
        { time: '2020-08-10', grade: '三年二班', name: '小明', subjects: '数学' },
        { time: '2020-08-10', grade: '总成绩', name: '总成绩', subjects: '总成绩' },
        { time: '2020-08-10', grade: '三年一班', name: '小雷', subjects: '语文' },
        { time: '2020-08-10', grade: '三年一班', name: '小雷', subjects: '数学' },
        { time: '2020-08-10', grade: '总成绩', name: '总成绩', subjects: '总成绩' },
        { time: '2020-08-11', grade: '三年三班', name: '小花', subjects: '语文' },
        { time: '2020-08-11', grade: '三年三班', name: '小花', subjects: '数学' },
        { time: '2020-08-11', grade: '总成绩', name: '总成绩', subjects: '总成绩' }
      ],
      colConfigs: [
        {
          label: '考试信息',
          align: 'center',
          type: 'label',
          children: [
            { prop: 'time', label: '考试时间', align: 'center' },
            { prop: 'grade', label: '所在班级', align: 'center' },
            { prop: 'name', label: '考生姓名', align: 'center' },
            { prop: 'subjects', label: '考试科目', align: 'center' }
          ]
        },
        { prop: 'results', label: '考试成绩', align: 'center', type: 'input' },
        { prop: 'remark', label: '备注', align: 'center', type: 'input' }
      ],
      mergeColumns: [
        { index: 2, name: 'time' },
        { index: 3, name: 'grade' },
        { index: 4, name: 'name' },
        { index: 5, name: 'subjects' }
      ]
    };
  },

  mounted() {


  },

  methods: {

  }
  //  End
}

</script>

<style lang='css' scoped>
</style>
